package com.cfgj.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;

/*
* 用户
* */
public class User {
    @TableId(type = IdType.AUTO)//解决封装id为BigInteger类型
    private Integer id;
    private String tell;
    private String password;
    private String email;
    @TableField(value = "createtime",fill = FieldFill.INSERT)
    private Date createtime;
    private Date lastlogintime;     //上次登录时间
    private double balance;     //余额
    private Integer status;

    public User(Integer id, String tell, String password,
                String email, Date createtime, Date lastlogintime, double balance, Integer status) {
        this.id = id;
        this.tell = tell;
        this.password = password;
        this.email = email;
        this.createtime = createtime;
        this.lastlogintime = lastlogintime;
        this.balance = balance;
        this.status = status;
    }

    public User() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTell() {
        return tell;
    }

    public void setTell(String tell) {
        this.tell = tell;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getLastlogintime() {
        return lastlogintime;
    }

    public void setLastlogintime(Date lastlogintime) {
        this.lastlogintime = lastlogintime;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public Integer getStatus() { return status; }

    public void setStatus(Integer status) { this.status = status; }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", tell='" + tell + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", createtime=" + createtime +
                ", lastlogintime=" + lastlogintime +
                ", balance=" + balance +
                ", status=" + status +
                '}';
    }
}
